/*
 * @Author: silence
 * @Date: 2023-06-30 08:57:58
 * @LastEditors: silence silence9685@163.com
 * @LastEditTime: 2023-07-19 15:46:17
 * @Description: 用户信息
 */
import 'package:sil_utils_package/log/SilEntityLog.dart';

class UserEntity {
  String? id;
  String? pid;
  String? state;
  String? roleId;
  String? userPhone;
  String? nickName;
  String? userPwd;
  String? userName;
  String? integral;
  String? email;
  String? country;
  String? countryName;
  String? avatar;
  String? createTime;
  String? isValid;
  String? userSex;
  String? cotwo;
  String? forest;
  String? coal;
  String? dieselOil;

  /// 用户当前选中的电站id
  String? powerRecordId;

  /// 区域码
  String? areaCode;
  UserEntity({
    this.id,
    this.pid,
    this.state,
    this.roleId,
    this.userPhone,
    this.nickName,
    this.userPwd,
    this.userName,
    this.integral,
    this.email,
    this.country,
    this.countryName,
    this.avatar,
    this.createTime,
    this.isValid,
    this.userSex,
    this.cotwo,
    this.forest,
    this.coal,
    this.dieselOil,
    this.powerRecordId,
    this.areaCode,
  });
  UserEntity.fromJson(Map<String, dynamic> json) {
    id = SilEntityLog.handleString(json, 'id');
    pid = SilEntityLog.handleString(json, 'pid');
    state = SilEntityLog.handleString(json, 'state');
    roleId = SilEntityLog.handleString(json, 'roleId');
    userPhone = SilEntityLog.handleString(json, 'userPhone');
    nickName = SilEntityLog.handleString(json, 'nickName');
    userPwd = SilEntityLog.handleString(json, 'userPwd');
    userName = SilEntityLog.handleString(json, 'userName');
    integral = SilEntityLog.handleString(json, 'integral');
    email = SilEntityLog.handleString(json, 'email');
    country = SilEntityLog.handleString(json, 'country');
    countryName = SilEntityLog.handleString(json, 'countryName');
    avatar = SilEntityLog.handleString(json, 'avatar');
    createTime = SilEntityLog.handleString(json, 'createTime');
    isValid = SilEntityLog.handleString(json, 'isValid');
    userSex = SilEntityLog.handleString(json, 'userSex');
    cotwo = SilEntityLog.handleString(json, 'cotwo');
    forest = SilEntityLog.handleString(json, 'forest');
    coal = SilEntityLog.handleString(json, 'coal');
    dieselOil = SilEntityLog.handleString(json, 'dieselOil');
    powerRecordId = SilEntityLog.handleString(json, 'powerRecordId');
    areaCode = SilEntityLog.handleString(json, 'areaCode');
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['pid'] = this.pid;
    data['state'] = this.state;
    data['roleId'] = this.roleId;
    data['userPhone'] = this.userPhone;
    data['nickName'] = this.nickName;
    data['userPwd'] = this.userPwd;
    data['userName'] = this.userName;
    data['integral'] = this.integral;
    data['email'] = this.email;
    data['country'] = this.country;
    data['countryName'] = this.countryName;
    data['avatar'] = this.avatar;
    data['createTime'] = this.createTime;
    data['isValid'] = this.isValid;
    data['userSex'] = this.userSex;
    data['cotwo'] = this.cotwo;
    data['forest'] = this.forest;
    data['coal'] = this.coal;
    data['dieselOil'] = this.dieselOil;
    data['powerRecordId'] = this.powerRecordId;
    data['areaCode'] = this.areaCode;
    return data;
  }
}
